﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using BadmintonApp.BLL.Interface;
using BadmintonApp.DAO.Interface;
using BadmintonApp.Factory;
using BadmintonApp.Entity;

namespace BadmintonApp.BLL.Implement
{
    public class AnnouncementBLL : IAnnouncementBLL
    {
        private IAnnouncementDAO dao;

        public AnnouncementBLL()
        {
            dao = DaoFactory.CreateAnnouncementDAO();
        }



        #region IAnnouncementBLL Members

        /// <summary>
        /// 插入公告
        /// </summary>
        /// <param name="annoInfo">公告信息类</param>
        public void InsertAnnouncement(TAnnouncementsInfo annoInfo)
        {
            dao.InsertAnnouncement(annoInfo);
        }

        /// <summary>
        /// 更新公告
        /// </summary>
        /// <param name="annoInfo">公告信息类</param>
        public void UpdateAnnouncement(TAnnouncementsInfo annoInfo)
        {
            dao.UpdateAnnouncement(annoInfo);
        }

        /// <summary>
        /// 删除公告
        /// </summary>
        /// <param name="annoID">公告ID</param>
        public void DeleteAnnouncement(int annoID)
        {
            dao.DeleteAnnouncement(annoID);
        }

        /// <summary>
        /// 获取所有公告
        /// </summary>
        /// <returns>公告数据集</returns>
        public DataSet GetAllAnnouncement()
        {
            return dao.GetAllAnnouncement();
        }

        #endregion
    }
}
